package lab02.Test11;

/**
 * Created by lenovo on 2017/10/20.
 */
public class Rectangle implements Printx {
    double length;
    double wide;

    Rectangle() {
    }

    public Rectangle(double length, double wide) {
        this.length = length;
        this.wide = wide;
    }

    public double area() {

        return length * wide;
    }

    public double girth() {

        return 2 * (length + wide);
    }

    @Override
    public void printMyWay() {
        System.out.println("长：" + length + "\t" + "宽：" + wide);
        System.out.println("面积为：" + area());
        System.out.println("周长为：" + girth());

    }
}
